import Ajv from 'ajv'

const ajv = new Ajv()

/**
 * 校验第三方平台收到的加密的消息体
 */
export const componentEncryptedBody = ajv.compile<Weixin.Component.EncryptedIncomingMessage>({
    type: 'object',
    properties: {
        appid: {
            type: 'string',
        },
        encrypt: {
            type: 'string',
        },
    },
    additionalProperties: true,
    required: ['appid', 'encrypt'],
})
